package o;

import android.content.Context;
import android.content.Intent;
import com.huawei.appgallery.appcomment.impl.bean.ApproveCommentReplyResBean;
import com.huawei.appgallery.appcomment.impl.bean.GetReplyResBean.ReplyComment;
import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;
import com.huawei.appgallery.serverreqkit.api.listener.IServerCallBack;
import java.lang.ref.WeakReference;
import o.bcg.h;
import o.bdm.e;

public class bdj implements IServerCallBack {
    private int ˋ;
    private String ˎ;
    private ReplyComment ˏ;
    private WeakReference<Context> ॱ;

    public bdj(ReplyComment replyComment, Context context, int i) {
        this.ॱ = new WeakReference(context);
        this.ˏ = replyComment;
        this.ˋ = i;
    }

    public bdj(String str, Context context, int i) {
        this.ॱ = new WeakReference(context);
        this.ˎ = str;
        this.ˋ = i;
    }

    public void prePostResult(BaseRequest o_cvu, ResponseBean responseBean) {
    }

    public void notifyResult(BaseRequest o_cvu, ResponseBean responseBean) {
        try {
            Context context = (Context) this.ॱ.get();
            if (context != null) {
                e eVar = new e();
                if ((responseBean instanceof ApproveCommentReplyResBean) && responseBean.getResponseCode() == 0) {
                    ॱ(context, ((ApproveCommentReplyResBean) responseBean).getRtnCode_(), eVar);
                } else {
                    ckv.ˎ(context.getString(h.ˎ), 0);
                    eVar.ˏ(0);
                }
                if (this.ˏ != null) {
                    eVar.ॱ(this.ˏ.ˏॱ());
                    eVar.ˋ(this.ˏ.ॱ());
                } else {
                    eVar.ˋ(this.ˎ);
                }
                Intent intent = new Intent("com.huawei.appmarket.service.broadcast.Approved.reply");
                intent.putExtra("ACTION_PARAM_COMMENT_APPROVED_REPLY", eVar);
                ll.ˏ(context).ˋ(intent);
            }
        } catch (Exception e) {
            bcb.ˋ.ˊ("ApproveCommentReplyCallBack", "notifyResult(RequestBean req, ResponseBean response) " + e.toString());
        }
    }

    private void ॱ(Context context, int i, e eVar) {
        switch (i) {
            case 0:
                if (this.ˋ == 0) {
                    eVar.ˎ(1);
                    eVar.ˏ(1);
                    return;
                }
                eVar.ˎ(-1);
                eVar.ˏ(0);
                return;
            case 1:
                ckv.ˎ(context.getString(h.ॱ), 0);
                eVar.ˏ(1);
                return;
            case 8:
                ckv.ˎ(context.getString(h.ʻ), 0);
                eVar.ˏ(0);
                return;
            case 9:
                ckv.ˎ(context.getString(h.ॱˊ), 0);
                eVar.ˏ(0);
                return;
            case 11:
                ckv.ˎ(context.getString(h.ʼ), 0);
                eVar.ˏ(0);
                return;
            case 12:
                ckv.ˎ(context.getString(h.ʽ), 0);
                eVar.ˏ(0);
                return;
            default:
                ckv.ˎ(context.getString(h.ˎ), 0);
                eVar.ˏ(0);
                return;
        }
    }
}
